<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <link href="/resource/css/bootstrap.css" rel="stylesheet">
    <script type="text/javascript" src="/resource/js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="/resource/js/bootstrap.js"></script>
</head>
        <body>
        <form action="add" method="post">
            <input type="hidden" name="token" value="${token}">
            用户名：<input type="text" name="name"><br>
            密  码：<input type="password" name="pwd"><br>
            <button type="button" onclick="add()">提交</button>
        </form>

        </body>
<script>
    function  add(){
       $.post("add",$("form").serialize(),function (obj){
           if(obj.code==600){
               alert(obj.msg)
           }else{
               alert(obj.msg)
           }
       })
    }
</script>
</html>